Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file uploads on python 3.4 and up. #13

Merged
merged 1 commit into from
Nov 4, 2016
Merged

Conversation

jinty
Copy link
Contributor

@jinty jinty commented Nov 4, 2016

cgi.FieldStorage explicitly closes files when it is garbage collected. For details, see:

We now keep a reference to the FieldStorage till we
are finished processing the request.

cgi.FieldStorage explicitly
closes files when it is garbage collected. For details, see:

  * http://bugs.python.org/issue18394
  * https://hg.python.org/cpython/rev/c0e9ba7b26d5

We now keep a reference to the FieldStorage till we
are finished processing the request.
Copy link
Member

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

27 similar comments
@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Travis is seriously unhappy on Python 3 for what look like unrelated reasons. Feel free to merge if the tests pass locally for you.

(In the past, instead of debugging the setup.py hacks that attempt to hook zope.testruner to setup.py test I'd change tox.ini to run zope-testrunner directly. E.g. zope.server's tox.ini is one example. Still, a matter for a separate pull request IMHO.)

@mgedmin
Copy link
Member

mgedmin commented Nov 4, 2016

Apologies for the comment flood.

I blame GitHub.

@jinty
Copy link
Contributor Author

jinty commented Nov 4, 2016

Wow, that's an impressive amount of comments. Here I thought you just
wanted to make your point really clear;)

Thanks, I tried out your idea here:
#14

It works pretty well and I managed to resist the temptation to type
py.test rather than zope-testrunner...

I'll wait a bit for anyone who wants to approve then commit both PR's
(as long as travis passes).

On Fri, Nov 04, 2016 at 03:37:44AM -0700, Marius Gedminas wrote:

Apologies for the comment flood.

I blame GitHub.

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#13 (comment)

Brian Sutherland

@jinty jinty merged commit 39d67bc into master Nov 4, 2016
@jinty jinty deleted the fix-file-uploads-python-3.4 branch November 4, 2016 16:57
jamadden added a commit to zopefoundation/zope.file that referenced this pull request Apr 21, 2017
The tests pass, but they need unreleased versions of
zope.app.basicskin (zopefoundation/zope.app.basicskin#1)
and zope.app.pagetemplate (zopefoundation/zope.app.pagetemplate#1).

We also have a workaround for
zopefoundation/zope.mimetype#6 (no issue/fix
yet) and the unreleased
zopefoundation/zope.publisher#13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants